#!/usr/bin/env python 
# -*- coding: utf-8 -*-

#PBS -N job_name
#PBS -o job.log
#PBS -e job.err
#PBS -q gold5120
#PBS -l nodes=1:ppn=4
#PBS -l walltime=22:00:00

import os
from ase.io import read
from ase.calculators.abacus.abacus_out import Abacus

os.environ['ASE_ABACUS_COMMAND'] = "mpirun -np 4 /home/shenzx/software/abacus/abacus_v2.0/bin/ABACUS.mpi.2.0 >> PREFIX.log"
WorkPath = "/home/shenzx/project/python_20190718/v20200729/ase-abacus/example/property/"
os.chdir(WorkPath)
bulk = read(WorkPath+"SiC.cif", format='cif')

calc = Abacus(atoms=bulk,
              pseudo_dir="/home/shenzx/software/abacus/SG15_ONCV_PBE_1.0",
              potential_name="PotSG15",
              basis_dir="/home/shenzx/software/abacus/Orb_DZP_E100_Standard_v1.0",
              basis_name="SG15act",
              niter=1000,
              dr2="1.0e-8",
              ecutwfc=100,
              calculation="scf",
              nspin=1,
              force=1,
              ks_solver='genelpa',
              basis_type='lcao',
              gamma_only=0,
              knumber=0,
              kmode='Gamma',
              kpts=[3, 3, 3, 0, 0, 0],
              )

bulk.set_calculator(calc)

print("Potential Energy: eV")
print(bulk.get_potential_energy())
print("Force:")
print(bulk.get_forces())
print("Fermi Level:")
print(calc.get_fermi_level())
quit()
